<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
</head>
<body>
	 
     <form action="${ctx}/user/login" method="post" onsubmit="return validate(this)">
	用户名：<input name="username" type="text"/><br> 
	密码：<input name="password" type="password"/><br> 
	<input type="submit" name="optype" value="登录"/>
     </form>
    ${msg}
  </body>
	<script type="text/javascript">
		function validate(myform){
		 	if(myform.username.value.length == 0){
	     		alert("用户名不能为空！");
				myform.username.focus();
	     		return false;
		 	}
		 	if(myform.password.value.length <2){
	     		alert("密码长度不能小于2！");
				myform.password.focus();
	     		return false;
		 	}
			return true;
		}
	</script>

</html>